import request from '@/utils/request'

export function getBackstage(data) {
  return request({
    url: '/system',
    method: 'post',
    params: data,
	loading: false,
  })
}
// 资源管理
export function getRolesList(data) {
  return request({
    url: '/system/role/res/query',
    method: 'post',
    params: data
  })
}
export function del(data) {
  return request({
    url: '/system/role/res/delete',
    method: 'post',
    params: data
  })
}

export function addRole(data) {
  return request({
    url: '/system/role/res/addsave',
    method: 'post',
    params: data
  })
}

//添加修改权限组
export function saveRoleInfo(data) {
  return request({
    url: '/system/role/manage/saveRoleInfo',
    method: 'post',
    params: data
  })
}

//获取权限组信息
export function getRoleInfo(data) {
  return request({
    url: '/system/role/manage/getRoleInfo',
    method: 'post',
    params: data
  })
}

//获取权限列表
export function getRoleQuery(data) {
  return request({
    url: '/system/role/manage/query',
    method: 'post',
    params: data
  })
}

//删除
export function RoleDelete(data) {
  return request({
    url: '/system/role/manage/delete',
    method: 'post',
    params: data
  })
}


export function updateRole(id, data) {
  return request({
    url: `/vue-element-admin/role/${id}`,
    method: 'put',
    data
  })
}

export function deleteRole(id) {
  return request({
    url: `/vue-element-admin/role/${id}`,
    method: 'delete'
  })
}
export function getRoutes() {
  return request({
    url: '/vue-element-admin/routes',
    method: 'get'
  })
}

export function getRoles() {
  return request({
    url: '/vue-element-admin/roles',
    method: 'get'
  })
}

// 支付配置
// 查询微信支付配置
export function getConfigWechat() {
  return request({
    url: '/system/pay/config/wechat',
    method: 'get'
  })
}
// 修改保存微信支付配置
export function saveWechat(data) {
  return request({
    url: '/system/pay/config/saveWechat',
    method: 'post',
    upFile:true,
    data
  })
}
// 查询支付宝配置
export function getConfigAlipay() {
  return request({
    url: '/system/pay/config/alipay',
    method: 'get'
  })
}
// 修改保存支付宝配置
export function saveAlipay(data) {
  return request({
    url: '/system/pay/config/saveAlipay',
    method: 'post',
    upFile:true,
    data
  })
}
// 支付配置结束

